Repository navigation
Convert notification-permission to a Kotlin Multiplatform module - #3365
Closed
StylianosGakis wants to merge 2 commits into
Closed
StylianosGakis wants to merge 2 commits into
StylianosGakis wants to merge 2 commits into
Conversation
The module now has JVM and Android targets. NotificationPermissionState, NotificationPermissionDialog and the preview state are declared in commonMain. The state no longer extends Accompanist's PermissionState: it has the same member names (permission, status, launchPermissionRequest) and a project-owned PermissionStatus with isGranted and shouldShowRationale extensions, so call sites only swap the import package of those symbols. The Android actual is the existing Accompanist implementation, adapting its status to the new type. The JVM actual reads as denied, never shows a dialog and ignores requests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI description
Turns
notification-permissioninto a Kotlin Multiplatform module (JVM and Android targets), so the feature modules that use it can move tocommonMainlater. Part of making the whole app run on a second platform (desktop).This is not a pure move.
NotificationPermissionStateused to extend Accompanist'sPermissionState, which cannot live incommonMain. It is now a project-owned interface with the same member names, and the Android implementation wraps Accompanist behind it. The launcher, the lifecycle checker and the dialog trigger are the same code in the same order, andstatusstill reads Accompanist's snapshot state on every access.Four call sites change one import package each. The first commit is a pure rename, review the second.
On the JVM target the permission reads as not granted and no dialog is shown.
Worth a manual check before merge: the notification permission prompt and its denied dialog on a device.